/*
结果为
{
count:280
}
*/
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	char s[5];
	int count=0;
	for(int i=10233;i<99234;++i){
		sprintf(s,"%d",i);
		for(int j=0;j<3;++j){
			if(s[j]=='2'&&s[j+1]=='3'&&s[j+2]=='3'){
				count++;
			}
		}
	}
	cout<<count;
	return 0; 
}